home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Kara Collection
/
Kara Collection v3.0 (1996-09-12)(Cloanto).iso
/
utilities
/
h
/
0
/
6
/
2
/
rexx
/
checkfixedfont.ctrx
< prev
next >
Wrap
Text File
|
1996-04-11
|
2KB
|
109 lines
/* ColorType Amiga Rexx script - Copyright © 1996 Cloanto Italia srl */
/* $VER: CheckFixedFont.ctrx 1.0 */
/**
This script scans the size and spacing values of all characters, verifying
whether the font meets the requirements of a "non-proportional" (fixed-width
characters and fixed-pitch spacing) font. As soon as a character is found
which does not meet the requirements, its data is displayed.
*/
IF ARG(1, EXISTS) THEN
PARSE ARG CTPORT
ELSE
CTPORT = 'COLORTYPE'
IF ~SHOW('P', CTPORT) THEN DO
IF EXISTS('ColorType:ColorType') THEN DO
ADDRESS COMMAND 'Run >NIL: ColorType:ColorType'
DO 30 WHILE ~SHOW('P',CTPORT)
ADDRESS COMMAND 'Wait >NIL: 1 SEC'
END
END
ELSE DO
SAY "ColorType could not be loaded."
EXIT 10
END
END
IF ~SHOW('P', CTPORT) THEN DO
SAY 'ColorType Rexx port could not be opened.'
EXIT 10
END
ADDRESS VALUE CTPORT
OPTIONS RESULTS
OPTIONS FAILAT 10000
LockGUI
GetChar
scnum = RESULT
SetChar FIRSTON
GetXSize
fixw = RESULT
GetKern
fixp = RESULT
GetSpace
fixp = fixp + RESULT
fixw_broken = -1
fixp_broken = -1
IF RC = 0 THEN DO
DO FOREVER
GetXSize
w = RESULT
GetKern
p = RESULT
GetSpace
p = p + RESULT
IF w ~= fixw & fixw_broken < 0 THEN DO
GetChar
fixw_broken = RESULT
fixw_bw = w
END
IF p ~= fixp & fixp_broken < 0 THEN DO
GetChar
fixp_broken = RESULT
fixp_bp = p
END
IF fixw_broken >= 0 & fixp_broken >= 0 THEN
LEAVE
SetChar NEXTON
IF RC ~= 0 THEN
LEAVE
END
SetChar scnum
msg = '"TEXT = '
IF fixw_broken < 0 THEN
msg = msg || '""It is a fixed-width font""'
ELSE DO
msg = msg || '""It is not a fixed-width font"" ' ||,
'TEXT = ""(the width of ch. 'fixw_broken' is 'fixw_bw')""'
END
msg = msg || ' SEPARATOR TEXT = '
IF fixp_broken < 0 THEN
msg = msg || '""It is a fixed-pitch font""'
ELSE DO
msg = msg || '""It is not a fixed-pitch font"" ' ||,
'TEXT = ""(the pitch of ch. 'fixp_broken' is 'fixp_bp')""'
END
msg = msg || ' ACTION = OKAY"'
Request '"CheckFixedFont"' msg
END
UnlockGUI